package com.shop.web;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.shop.entity.UserInfo;

public class LoginAction extends ActionSupport {

	private UserInfo userInfo;
	
	@Override
	public String execute() throws Exception {
		Map<String,Object> session  =ActionContext.getContext().getSession();
		if( "admin".equals(userInfo.getUsername()) && "123456".equals(userInfo.getPassword()) ){
			session.put("user", userInfo);
		}
		return super.execute();
	}

	public UserInfo getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}
	
	
	

}
